#Boa:Frame:JanelaPrincipal
# -*- coding: cp1252 -*-

import wx
from Controle.ClienteController import ClienteController
from Controle.NotaController import NotaController

def create(parent):
    return JanelaPrincipal(parent)

[wxID_JANELAPRINCIPAL, wxID_JANELAPRINCIPALBITMAPBUTTONCLIENTES, 
 wxID_JANELAPRINCIPALBITMAPBUTTONFUNCIONARIOS, 
 wxID_JANELAPRINCIPALBITMAPBUTTONPRODUTOS, 
 wxID_JANELAPRINCIPALBITMAPBUTTONSEND, 
 wxID_JANELAPRINCIPALBITMAPBUTTONSERVICOS, 
 wxID_JANELAPRINCIPALBITMAPBUTTON_OPENREPORTCLI, 
 wxID_JANELAPRINCIPALBUTTONADDCLI, wxID_JANELAPRINCIPALBUTTONADDFUNC, 
 wxID_JANELAPRINCIPALBUTTONADDPRO, wxID_JANELAPRINCIPALBUTTONADDSERV, 
 wxID_JANELAPRINCIPALLISTCTRL1, wxID_JANELAPRINCIPALLISTCTRLANIV, 
 wxID_JANELAPRINCIPALLISTCTRLNOTAS, wxID_JANELAPRINCIPALNOTEBOOK1, 
 wxID_JANELAPRINCIPALNOTEBOOK_REPORT, wxID_JANELAPRINCIPALPANEL1, 
 wxID_JANELAPRINCIPALPANEL10, wxID_JANELAPRINCIPALPANEL2, 
 wxID_JANELAPRINCIPALPANEL3, wxID_JANELAPRINCIPALPANEL4, 
 wxID_JANELAPRINCIPALPANEL6, wxID_JANELAPRINCIPALPANEL7, 
 wxID_JANELAPRINCIPALPANEL8, wxID_JANELAPRINCIPALPANEL9, 
 wxID_JANELAPRINCIPALSASHWINDOW1, wxID_JANELAPRINCIPALSASHWINDOW2, 
 wxID_JANELAPRINCIPALSASHWINDOW3, wxID_JANELAPRINCIPALSASHWINDOW4, 
 wxID_JANELAPRINCIPALSASHWINDOW5, wxID_JANELAPRINCIPALSTATICBITMAP1, 
 wxID_JANELAPRINCIPALSTATICBOX1, wxID_JANELAPRINCIPALSTATICBOX2, 
 wxID_JANELAPRINCIPALSTATICLINE1, wxID_JANELAPRINCIPALSTATICTEXT1, 
 wxID_JANELAPRINCIPALSTATICTEXT2, wxID_JANELAPRINCIPALSTATICTEXT3, 
 wxID_JANELAPRINCIPALSTATUSBAR1, wxID_JANELAPRINCIPALTEXTCTRL_CLIANTIGO, 
 wxID_JANELAPRINCIPALTEXTCTRL_CLIRECENTE, wxID_JANELAPRINCIPALTEXTCTRL_NUMCLI, 
 wxID_JANELAPRINCIPALTOOLBAR_NOTES, wxID_JANELAPRINCIPALWINDOW1, 
] = [wx.NewId() for _init_ctrls in range(43)]


[wxID_JANELAPRINCIPALMENU1ITEMLOGOFF, wxID_JANELAPRINCIPALMENU1ITEMSOPCOES, 
 wxID_JANELAPRINCIPALMENU1ITEMSSAIR, wxID_JANELAPRINCIPALMENU1ITEMSSOBRE, 
] = [wx.NewId() for _init_coll_menu_Items in range(4)]

[wxID_JANELAPRINCIPALTOOLBARCLIENTESTOOLSADDCLIENTE, 
 wxID_JANELAPRINCIPALTOOLBARCLIENTESTOOLSCLIENTES, 
] = [wx.NewId() for _init_coll_toolBarClientes_Tools in range(2)]

[wxID_JANELAPRINCIPALTOOLBAR_REPORTCLITOOLS_OPENREPORTCLI] = [wx.NewId() for _init_coll_toolBar_reportcli_Tools in range(1)]

[wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_LIMPAR, 
 wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_NEWNOTE, 
 wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_REMOVERNOTA, 
] = [wx.NewId() for _init_coll_toolBar_notes_Tools in range(3)]

class JanelaPrincipal(wx.Frame):
    def _init_coll_menuBar_Menus(self, parent):
        # generated method, don't edit

        parent.Append(menu=self.menu, title=u"Cristina's Hair")

    def _init_coll_menu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_JANELAPRINCIPALMENU1ITEMLOGOFF,
              kind=wx.ITEM_NORMAL, text=u'Fazer Log Off')
        parent.Append(help='', id=wxID_JANELAPRINCIPALMENU1ITEMSOPCOES,
              kind=wx.ITEM_NORMAL, text=u'Op\xe7\xf5es')
        parent.Append(help='', id=wxID_JANELAPRINCIPALMENU1ITEMSSOBRE,
              kind=wx.ITEM_NORMAL, text=u'Sobre')
        parent.Append(help='', id=wxID_JANELAPRINCIPALMENU1ITEMSSAIR,
              kind=wx.ITEM_NORMAL, text=u'Sair')
        self.Bind(wx.EVT_MENU, self.OnMenu1itemssairMenu,
              id=wxID_JANELAPRINCIPALMENU1ITEMSSAIR)
        self.Bind(wx.EVT_MENU, self.OnMenu1itemssobreMenu,
              id=wxID_JANELAPRINCIPALMENU1ITEMSSOBRE)

    def _init_coll_toolBar_notes_Tools(self, parent):
        # generated method, don't edit

        parent.AddSeparator()
        parent.DoAddTool(bitmap=wx.Bitmap(u"Img/newnote.gif",
              wx.BITMAP_TYPE_GIF), bmpDisabled=wx.Bitmap(u"Img/newnote.gif",
              wx.BITMAP_TYPE_GIF),
              id=wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_NEWNOTE,
              kind=wx.ITEM_NORMAL, label='', longHelp='',
              shortHelp=u'Adicionar Nota')
        parent.AddSeparator()
        parent.DoAddTool(bitmap=wx.Bitmap(u"Img/remove.gif",
              wx.BITMAP_TYPE_GIF), bmpDisabled=wx.Bitmap(u"Img/remove.gif",
              wx.BITMAP_TYPE_GIF),
              id=wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_REMOVERNOTA,
              kind=wx.ITEM_NORMAL, label='', longHelp='',
              shortHelp=u'Remover Nota')
        parent.AddSeparator()
        parent.DoAddTool(bitmap=wx.Bitmap(u"Img/clean.gif", wx.BITMAP_TYPE_GIF),
              bmpDisabled=wx.Bitmap(u"Img/clean.gif", wx.BITMAP_TYPE_GIF),
              id=wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_LIMPAR,
              kind=wx.ITEM_NORMAL, label='', longHelp='',
              shortHelp=u'Limpar Selecionadas')
        self.Bind(wx.EVT_TOOL, self.OnToolBar_notesTools_newnoteTool,
              id=wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_NEWNOTE)
        self.Bind(wx.EVT_TOOL, self.OnToolBar_notesTools_removernotaTool,
              id=wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_REMOVERNOTA)
        self.Bind(wx.EVT_TOOL, self.OnToolBar_notesTools_limparTool,
              id=wxID_JANELAPRINCIPALTOOLBAR_NOTESTOOLS_LIMPAR)

        parent.Realize()

    def _init_coll_listCtrl1_Columns(self, parent):
        # generated method, don't edit

        parent.InsertColumn(col=0, format=wx.LIST_FORMAT_LEFT,
              heading=u'Produto', width=-1)
        parent.InsertColumn(col=1, format=wx.LIST_FORMAT_LEFT,
              heading=u'M\xednima', width=-2)
        parent.InsertColumn(col=2, format=wx.LIST_FORMAT_LEFT, heading=u'Atual',
              width=-2)

    def _init_coll_notebook1_Pages(self, parent):
        # generated method, don't edit

        parent.AddPage(imageId=-1, page=self.panel2, select=True,
              text=u'Cadastros')
        parent.AddPage(imageId=-1, page=self.panel6, select=False,
              text=u'Agendamentos')
        parent.AddPage(imageId=-1, page=self.panel7, select=False,
              text=u'Faturamentos')
        parent.AddPage(imageId=-1, page=self.panel8, select=False,
              text=u'Cobran\xe7as')
        parent.AddPage(imageId=-1, page=self.panel9, select=False,
              text=u'Relat\xf3rios')
        parent.AddPage(imageId=-1, page=self.panel10, select=False,
              text=u'Avan\xe7ado')

    def _init_coll_listCtrlAniv_Columns(self, parent):
        # generated method, don't edit

        parent.InsertColumn(col=0, format=wx.LIST_FORMAT_LEFT,
              heading=u'Cliente', width=-1)
        parent.InsertColumn(col=1, format=wx.LIST_FORMAT_LEFT, heading=u'Data',
              width=-2)

    def _init_coll_listCtrlNotas_Columns(self, parent):
        # generated method, don't edit

        parent.InsertColumn(col=0, format=wx.LIST_FORMAT_LEFT,
              heading=u'Descri\xe7\xe3o', width=-2)
        parent.InsertColumn(col=1, format=wx.LIST_FORMAT_LEFT, heading=u'Data',
              width=-2)

    def _init_coll_notebook_report_Pages(self, parent):
        # generated method, don't edit

        parent.AddPage(imageId=-1, page=self.sashWindow1, select=True,
              text=u'Por Clientes')
        parent.AddPage(imageId=-1, page=self.sashWindow2, select=False,
              text=u'Por Funcion\xe1rios')
        parent.AddPage(imageId=-1, page=self.sashWindow3, select=False,
              text=u'Por Produtos')
        parent.AddPage(imageId=-1, page=self.sashWindow4, select=False,
              text=u'Por Servi\xe7o')

    def _init_coll_statusBar1_Fields(self, parent):
        # generated method, don't edit
        parent.SetFieldsCount(1)

        parent.SetStatusText(number=0,
              text=u"Cristina's Hair - Software Powered by MVR Solu\xe7\xf5es em Sistemas de Informa\xe7\xe3o")

        parent.SetStatusWidths([-1])

    def _init_utils(self):
        # generated method, don't edit
        self.menu = wx.Menu(title='')

        self.menuBar = wx.MenuBar()

        self._init_coll_menu_Items(self.menu)
        self._init_coll_menuBar_Menus(self.menuBar)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_JANELAPRINCIPAL,
              name=u'JanelaPrincipal', parent=prnt, pos=wx.Point(7, 4),
              size=wx.Size(1359, 724), style=wx.DEFAULT_FRAME_STYLE,
              title=u"Christina's Hair - Beta v0.1")
        self._init_utils()
        self.SetClientSize(wx.Size(1343, 686))
        self.SetBackgroundColour(wx.Colour(255, 255, 255))
        self.Center(wx.BOTH)
        self.SetMenuBar(self.menuBar)

        self.statusBar1 = wx.StatusBar(id=wxID_JANELAPRINCIPALSTATUSBAR1,
              name='statusBar1', parent=self, style=0)
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

        self.notebook1 = wx.Notebook(id=wxID_JANELAPRINCIPALNOTEBOOK1,
              name='notebook1', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(1368, 112), style=0)

        self.panel1 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL1, name='panel1',
              parent=self, pos=wx.Point(0, 112), size=wx.Size(1352, 512),
              style=wx.TAB_TRAVERSAL)

        self.staticBitmap1 = wx.StaticBitmap(bitmap=wx.Bitmap(u"Img/Logotipo_completo_350x455.jpg",
              wx.BITMAP_TYPE_JPEG), id=wxID_JANELAPRINCIPALSTATICBITMAP1,
              name='staticBitmap1', parent=self.panel1, pos=wx.Point(344, 24),
              size=wx.Size(360, 455), style=0)

        self.listCtrl1 = wx.ListCtrl(id=wxID_JANELAPRINCIPALLISTCTRL1,
              name='listCtrl1', parent=self.panel1, pos=wx.Point(720, 16),
              size=wx.Size(256, 472), style=wx.LC_REPORT)
        self._init_coll_listCtrl1_Columns(self.listCtrl1)

        self.panel2 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL2, name='panel2',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(1360, 86),
              style=wx.TAB_TRAVERSAL)

        self.panel6 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL6, name='panel6',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(1360, 86),
              style=wx.TAB_TRAVERSAL)

        self.panel7 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL7, name='panel7',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(1360, 86),
              style=wx.TAB_TRAVERSAL)

        self.panel8 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL8, name='panel8',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(1360, 86),
              style=wx.TAB_TRAVERSAL)

        self.panel9 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL9, name='panel9',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(1360, 86),
              style=wx.TAB_TRAVERSAL)

        self.panel10 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL10, name='panel10',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(1360, 86),
              style=wx.TAB_TRAVERSAL)

        self.bitmapButtonClientes = wx.BitmapButton(bitmap=wx.Bitmap(u"Img/cliente.png",
              wx.BITMAP_TYPE_PNG), id=wxID_JANELAPRINCIPALBITMAPBUTTONCLIENTES,
              name=u'bitmapButtonClientes', parent=self.panel2, pos=wx.Point(0,
              0), size=wx.Size(64, 64), style=wx.BU_AUTODRAW)
        self.bitmapButtonClientes.Bind(wx.EVT_BUTTON,
              self.OnBitmapButtonClientesButton,
              id=wxID_JANELAPRINCIPALBITMAPBUTTONCLIENTES)

        self.buttonAddcli = wx.Button(id=wxID_JANELAPRINCIPALBUTTONADDCLI,
              label=u'+', name=u'buttonAddcli', parent=self.panel2,
              pos=wx.Point(0, 64), size=wx.Size(64, 16), style=0)
        self.buttonAddcli.Bind(wx.EVT_BUTTON, self.OnButtonAddcliButton,
              id=wxID_JANELAPRINCIPALBUTTONADDCLI)

        self.bitmapButtonFuncionarios = wx.BitmapButton(bitmap=wx.Bitmap(u"Img/funcionario.png",
              wx.BITMAP_TYPE_PNG),
              id=wxID_JANELAPRINCIPALBITMAPBUTTONFUNCIONARIOS,
              name=u'bitmapButtonFuncionarios', parent=self.panel2,
              pos=wx.Point(88, 0), size=wx.Size(64, 64), style=wx.BU_AUTODRAW)
        self.bitmapButtonFuncionarios.Enable(True)
        self.bitmapButtonFuncionarios.Show(False)

        self.buttonAddFunc = wx.Button(id=wxID_JANELAPRINCIPALBUTTONADDFUNC,
              label=u'+', name=u'buttonAddFunc', parent=self.panel2,
              pos=wx.Point(88, 64), size=wx.Size(64, 16), style=0)
        self.buttonAddFunc.Show(False)

        self.bitmapButtonServicos = wx.BitmapButton(bitmap=wx.Bitmap(u"Img/servico.png",
              wx.BITMAP_TYPE_PNG), id=wxID_JANELAPRINCIPALBITMAPBUTTONSERVICOS,
              name=u'bitmapButtonServicos', parent=self.panel2,
              pos=wx.Point(176, 0), size=wx.Size(64, 64), style=wx.BU_AUTODRAW)
        self.bitmapButtonServicos.Show(False)

        self.buttonAddServ = wx.Button(id=wxID_JANELAPRINCIPALBUTTONADDSERV,
              label=u'+', name=u'buttonAddServ', parent=self.panel2,
              pos=wx.Point(176, 64), size=wx.Size(64, 16), style=0)
        self.buttonAddServ.Show(False)

        self.bitmapButtonProdutos = wx.BitmapButton(bitmap=wx.Bitmap(u"Img/produtos.png",
              wx.BITMAP_TYPE_PNG), id=wxID_JANELAPRINCIPALBITMAPBUTTONPRODUTOS,
              name=u'bitmapButtonProdutos', parent=self.panel2,
              pos=wx.Point(264, 0), size=wx.Size(64, 64), style=wx.BU_AUTODRAW)
        self.bitmapButtonProdutos.Show(False)

        self.buttonAddPro = wx.Button(id=wxID_JANELAPRINCIPALBUTTONADDPRO,
              label=u'+', name=u'buttonAddPro', parent=self.panel2,
              pos=wx.Point(264, 64), size=wx.Size(64, 16), style=0)
        self.buttonAddPro.Show(False)

        self.window1 = wx.Window(id=wxID_JANELAPRINCIPALWINDOW1, name='window1',
              parent=self.panel1, pos=wx.Point(992, 8), size=wx.Size(352, 496),
              style=0)
        self.window1.SetBackgroundColour(wx.Colour(255, 255, 255))

        self.notebook_report = wx.Notebook(id=wxID_JANELAPRINCIPALNOTEBOOK_REPORT,
              name=u'notebook_report', parent=self.window1, pos=wx.Point(8, 8),
              size=wx.Size(336, 472), style=0)

        self.sashWindow1 = wx.SashWindow(id=wxID_JANELAPRINCIPALSASHWINDOW1,
              name='sashWindow1', parent=self.notebook_report, pos=wx.Point(0,
              0), size=wx.Size(328, 446), style=wx.CLIP_CHILDREN | wx.SW_3D)

        self.sashWindow2 = wx.SashWindow(id=wxID_JANELAPRINCIPALSASHWINDOW2,
              name='sashWindow2', parent=self.notebook_report, pos=wx.Point(0,
              0), size=wx.Size(328, 446), style=wx.CLIP_CHILDREN | wx.SW_3D)

        self.sashWindow3 = wx.SashWindow(id=wxID_JANELAPRINCIPALSASHWINDOW3,
              name='sashWindow3', parent=self.notebook_report, pos=wx.Point(0,
              0), size=wx.Size(328, 446), style=wx.CLIP_CHILDREN | wx.SW_3D)

        self.sashWindow4 = wx.SashWindow(id=wxID_JANELAPRINCIPALSASHWINDOW4,
              name='sashWindow4', parent=self.notebook_report, pos=wx.Point(0,
              0), size=wx.Size(328, 446), style=wx.CLIP_CHILDREN | wx.SW_3D)

        self.panel3 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL3, name='panel3',
              parent=self.sashWindow1, pos=wx.Point(0, 0), size=wx.Size(328,
              446), style=wx.TAB_TRAVERSAL)

        self.bitmapButton_openreportcli = wx.BitmapButton(bitmap=wx.Bitmap(u"Img/Open report.png",
              wx.BITMAP_TYPE_PNG),
              id=wxID_JANELAPRINCIPALBITMAPBUTTON_OPENREPORTCLI,
              name=u'bitmapButton_openreportcli', parent=self.panel3,
              pos=wx.Point(108, 8), size=wx.Size(112, 32),
              style=wx.BU_AUTODRAW)
        self.bitmapButton_openreportcli.Center(wx.HORIZONTAL)

        self.staticLine1 = wx.StaticLine(id=wxID_JANELAPRINCIPALSTATICLINE1,
              name='staticLine1', parent=self.panel3, pos=wx.Point(8, 48),
              size=wx.Size(312, 2), style=0)

        self.staticBox1 = wx.StaticBox(id=wxID_JANELAPRINCIPALSTATICBOX1,
              label=u'', name='staticBox1', parent=self.panel3, pos=wx.Point(8,
              56), size=wx.Size(312, 176), style=0)

        self.staticText1 = wx.StaticText(id=wxID_JANELAPRINCIPALSTATICTEXT1,
              label=u'N\xba de Clientes Cadastrados:', name='staticText1',
              parent=self.panel3, pos=wx.Point(16, 72), size=wx.Size(181, 16),
              style=0)
        self.staticText1.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD,
              False, u'Tahoma'))

        self.textCtrl_NumCli = wx.TextCtrl(id=wxID_JANELAPRINCIPALTEXTCTRL_NUMCLI,
              name=u'textCtrl_NumCli', parent=self.panel3, pos=wx.Point(16, 88),
              size=wx.Size(64, 21), style=0, value=u'')
        self.textCtrl_NumCli.Enable(False)

        self.staticText2 = wx.StaticText(id=wxID_JANELAPRINCIPALSTATICTEXT2,
              label=u'Cliente Mais Antigo:', name='staticText2',
              parent=self.panel3, pos=wx.Point(16, 128), size=wx.Size(129, 16),
              style=0)
        self.staticText2.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD,
              False, u'Tahoma'))

        self.staticText3 = wx.StaticText(id=wxID_JANELAPRINCIPALSTATICTEXT3,
              label=u'Cliente Mais Recente:', name='staticText3',
              parent=self.panel3, pos=wx.Point(16, 184), size=wx.Size(140, 16),
              style=0)
        self.staticText3.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD,
              False, u'Tahoma'))

        self.textCtrl_CliAntigo = wx.TextCtrl(id=wxID_JANELAPRINCIPALTEXTCTRL_CLIANTIGO,
              name=u'textCtrl_CliAntigo', parent=self.panel3, pos=wx.Point(16,
              144), size=wx.Size(272, 21), style=0, value=u'')
        self.textCtrl_CliAntigo.Enable(False)

        self.textCtrl_CliRecente = wx.TextCtrl(id=wxID_JANELAPRINCIPALTEXTCTRL_CLIRECENTE,
              name=u'textCtrl_CliRecente', parent=self.panel3, pos=wx.Point(16,
              200), size=wx.Size(272, 21), style=0, value=u'')
        self.textCtrl_CliRecente.Enable(False)

        self.sashWindow5 = wx.SashWindow(id=wxID_JANELAPRINCIPALSASHWINDOW5,
              name='sashWindow5', parent=self.panel1, pos=wx.Point(8, 16),
              size=wx.Size(320, 456), style=wx.CLIP_CHILDREN | wx.SW_3D)

        self.toolBar_notes = wx.ToolBar(id=wxID_JANELAPRINCIPALTOOLBAR_NOTES,
              name=u'toolBar_notes', parent=self.sashWindow5, pos=wx.Point(0,
              0), size=wx.Size(320, 31), style=wx.TB_HORIZONTAL | wx.NO_BORDER)

        self.panel4 = wx.Panel(id=wxID_JANELAPRINCIPALPANEL4, name='panel4',
              parent=self.sashWindow5, pos=wx.Point(8, 40), size=wx.Size(304,
              408), style=wx.TAB_TRAVERSAL)
        self.panel4.SetBackgroundColour(wx.Colour(255, 255, 255))

        self.staticBox2 = wx.StaticBox(id=wxID_JANELAPRINCIPALSTATICBOX2,
              label=u'Aniversariantes da Semana', name='staticBox2',
              parent=self.panel3, pos=wx.Point(8, 240), size=wx.Size(312, 200),
              style=0)
        self.staticBox2.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              u'Tahoma'))

        self.listCtrlNotas = wx.ListCtrl(id=wxID_JANELAPRINCIPALLISTCTRLNOTAS,
              name=u'listCtrlNotas', parent=self.panel4, pos=wx.Point(0, 0),
              size=wx.Size(304, 408), style=wx.LC_REPORT)
        self.listCtrlNotas.SetBackgroundColour(wx.Colour(253, 253, 197))
        self.listCtrlNotas.SetBackgroundStyle(wx.BG_STYLE_SYSTEM)
        self.listCtrlNotas.SetFont(wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL,
              False, u'Arial Narrow'))
        self._init_coll_listCtrlNotas_Columns(self.listCtrlNotas)

        self.listCtrlAniv = wx.ListCtrl(id=wxID_JANELAPRINCIPALLISTCTRLANIV,
              name=u'listCtrlAniv', parent=self.panel3, pos=wx.Point(16, 264),
              size=wx.Size(296, 136), style=wx.LC_REPORT)
        self._init_coll_listCtrlAniv_Columns(self.listCtrlAniv)

        self.bitmapButtonSend = wx.BitmapButton(bitmap=wx.Bitmap(u"Img/send.gif",
              wx.BITMAP_TYPE_GIF), id=wxID_JANELAPRINCIPALBITMAPBUTTONSEND,
              name=u'bitmapButtonSend', parent=self.panel3, pos=wx.Point(112,
              408), size=wx.Size(104, 24), style=wx.BU_AUTODRAW)
        self.bitmapButtonSend.Center(wx.HORIZONTAL)
        self.bitmapButtonSend.Bind(wx.EVT_BUTTON, self.OnBitmapButtonSendButton,
              id=wxID_JANELAPRINCIPALBITMAPBUTTONSEND)

        self._init_coll_notebook1_Pages(self.notebook1)
        self._init_coll_notebook_report_Pages(self.notebook_report)
        self._init_coll_toolBar_notes_Tools(self.toolBar_notes)

    def __init__(self, parent):
        self._init_ctrls(parent)
        self.__initialize__()

    def __initialize__(self):
        self.__preencherPorCliente__()
##        self.__preencherNotas__()
        
        
    def OnButtonAddcliButton(self, event):
        from Dialog_CadastrarCliente import *
        frame = CadastrarCliente(self)
        frame.Centre()
        frame.ShowModal()
        self.__preencherPorCliente__()

    def OnBitmapButtonClientesButton(self, event):
        from Frame_GerenciarClientes import *
        frame = GerenciarClientes(self, self.clientes)
        frame.Centre()
        frame.Show()
        self.__preencherNotas__()
        
#Preencher CheckListBox Notas
##    def __preencherNotas__(self):
##        controller = NotaController()
##        self.notas = controller.pesquisarNotas()
##        notas = self.notas
##        descricaoNotas = []
##        for i in notas:
##            descricaoNotas.append(i.getDescricao())
##        self.checkListBox_notes.SetItems(descricaoNotas)
##        
##        for i in range (len(notas)):
##            if notas[i].getFeito() == True:
##                self.checkListBox_notes.Check(i)
        
#Preencher relatorio PorCliente
    def __preencherPorCliente__(self):
        self.controller = ClienteController()
        self.clientes = self.controller.pesquisarClientesNome('')
        clientes = self.clientes
        clienteMaisAntigo = ''
        clienteMaisRecente = ''
        numClientesCadastrados = len(clientes)
        if numClientesCadastrados == 0:
            self.textCtrl_CliAntigo.SetValue(clienteMaisAntigo)
            self.textCtrl_CliRecente.SetValue(clienteMaisRecente)

        if numClientesCadastrados == 1:
            clienteMaisAntigo = clientes[0]
            clienteMaisRecente= clientes[0]
            self.textCtrl_CliAntigo.SetValue(clienteMaisAntigo.getNome())
            self.textCtrl_CliRecente.SetValue(clienteMaisRecente.getNome())

        elif len(clientes) >= 2:
            clienteMaisRecente = clientes[0]
            clienteMaisAntigo  = clientes[0]
            for i in range(numClientesCadastrados):
                if (clientes[i].getDataCriacao() > clienteMaisRecente.getDataCriacao()):
                    clienteMaisRecente = clientes[i]
                if (clientes[i].getDataCriacao() < clienteMaisAntigo.getDataCriacao()):
                    clienteMaisAntigo = clientes[i]
            self.textCtrl_CliAntigo.SetValue(clienteMaisAntigo.getNome())
            self.textCtrl_CliRecente.SetValue(clienteMaisRecente.getNome())
                
        self.textCtrl_NumCli.SetValue(str(numClientesCadastrados))
        

    def OnToolBar_notesTools_newnoteTool(self, event):
        from Dialog_CadastrarNota import *
        Dialog = CadastrarNota(self)
        Dialog.ShowModal()
        self.__preencherNotas__()

    def OnToolBar_notesTools_removernotaTool(self, event):
        num = self.checkListBox_notes.GetSelection()
        nota = self.notas[num]
        
        controller = NotaController()
        controller.removerNota(nota)
        self.notas.remove(nota)
        self.__preencherNotas__()

    def OnToolBar_notesTools_limparTool(self, event):
        controller = NotaController()
        for i in range(len(self.notas)):
            if self.checkListBox_notes.IsChecked(i):
                controller.removerNota(self.notas[i])
                self.notas.remove(self.notas[i])
        self.__preencherNotas__()


    def OnCheckListBox_notesChecklistbox(self, event):
        controller = NotaController()
        for i in range(len(self.notas)):
            if self.checkListBox_notes.IsChecked(i):
                self.notas[i].setFeito(1)
            else:
                self.notas[i].setFeito(0)
            controller.editarNota(self.notas[i])

    def OnMenu1itemssairMenu(self, event):
        self.Close()

    def OnMenu1itemssobreMenu(self, event):
        from Dialog_About import *
        dialog = About(self)
        dialog.ShowModal()

    def OnBitmapButtonSendButton(self, event):
        event.Skip()
